package com_djm_2025_06_09.myString.StringBuilderDemo;

/**
 * @author dengjiangming
 * @version 1.0.0
 * @date 2025-06-09
 */
public class StringBuilderDemo4 {

    public static void main(String[] args) {
        //1.创建对象
        StringBuilder stringBuilder = new StringBuilder();

        //2.添加字符串
        stringBuilder.append("aaa").append("bbb").append("ccc").append("ddd");

        //打印
        System.out.println(stringBuilder);

        //再把StringBuilder变回字符串
        String str = stringBuilder.toString();
        System.out.println(str);
    }
}
